package com.hdu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hdu.dto.UserInfoDTO;
import com.hdu.entity.UserInfo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 用户信息实体类 Mapper 接口
 * </p>
 *
 * @author xiaobai
 * @since 2024-05-21
 */
public interface UserInfoMapper extends BaseMapper<UserInfo> {

    @Update("update user_info,user_auth set avatar=#{avatar} where user_info.id=user_info_id and username=#{id}")
    void updateAvatar(Integer id, String avatar);

    @Select("select user_info.* from user_info,user_auth where user_info.id=user_info_id and username=#{id}")
    UserInfoDTO getUserInfo(String id);
}
